package edu.ubbcs.rs.web;

import com.vaadin.annotations.Theme;
import com.vaadin.cdi.CDIUI;
import com.vaadin.cdi.CDIViewProvider;
import com.vaadin.cdi.URLMapping;
import com.vaadin.navigator.Navigator;
import com.vaadin.navigator.ViewChangeListener;
import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
import javax.inject.Inject;

/**
 * @author Merli Andras-Bertalan
 * @version 1.0
 * @created 09-jan.-2015 15:37:45
 */
@Theme("mytheme")
@URLMapping("/main/*")
@CDIUI
public class ReservationSystemUi extends UI implements ViewChangeListener {
    @Inject
    private CDIViewProvider    viewProvider;

    @Override
    protected void init(final VaadinRequest request) {
        getPage().setTitle("Reservation System");
        
        final VerticalLayout layout = new VerticalLayout(new Label("Size"));
        layout.setSizeFull();
        Navigator navigator = new Navigator(ReservationSystemUi.this, layout);
        navigator.addProvider(viewProvider);
        setContent(layout);

    }

    @Override
    public boolean beforeViewChange(ViewChangeEvent event) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public void afterViewChange(ViewChangeEvent event) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
}